import VMdPreview from '@kangc/v-md-editor/lib/preview'
import '@kangc/v-md-editor/lib/style/preview.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index'
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css'
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index'
import createTodoListPlugin from '@kangc/v-md-editor/lib/plugins/todo-list/index'
import '@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css'
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index'
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css'
import createTipPlugin from '@kangc/v-md-editor/lib/plugins/tip/index'
import '@kangc/v-md-editor/lib/plugins/tip/tip.css'
import createAlignPlugin from '@kangc/v-md-editor/lib/plugins/align'
import createMermaidPlugin from '@kangc/v-md-editor/lib/plugins/mermaid/cdn'
import '@kangc/v-md-editor/lib/plugins/mermaid/mermaid.css'
import createKatexPlugin from '@kangc/v-md-editor/lib/plugins/katex/cdn'
import Prism from 'prismjs'

VMdPreview.use(vuepressTheme, {
  Prism,
})

VMdPreview.use(createCopyCodePlugin())
VMdPreview.use(createLineNumbertPlugin())
VMdPreview.use(createTodoListPlugin())
VMdPreview.use(createEmojiPlugin())
VMdPreview.use(createTipPlugin())
VMdPreview.use(createAlignPlugin())
window.mermaid && VMdPreview.use(createMermaidPlugin())
createKatexPlugin && VMdPreview.use(createKatexPlugin())

export default VMdPreview
